package edu.zut.cs.software.perfect.teacher.domain;

import javax.persistence.Column;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import edu.zut.cs.software.perfect.base.domain.BaseEntity;

/**
 * @ClassName teacher
 * @Description TODO
 * @Author lixianglong
 * @Date 2020年6月2日 下午11:47
 * @Version 1.0
 */
@Table(name = "T_TEACHER")
@Entity
public class Teacher extends BaseEntity<Long> {

	
	
	
	/**
	 * Many teacher objects relate to one department.
	 */
	@ManyToOne
	@JoinColumn(name = "DEPARTMENT_ID")
	Department department;
	
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	private static final long serialVersionUID = 1292872307625090685L;

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/**
	 * name for teacher
	 */
	@Column(name = "NAME")
	String name;
	/**
	 * workid for teacher
	 */
	@Column(name = "WorkID")
	Long workid;
	/**
	 * sex for teacher
	 */
	@Column(name = "SEX")
	String sex;

	/**
	 * age for teacher
	 */
	@Column(name = "AGE")
	int age;
	/**
	 * departmentcode for teacher
	 * */
	@Column(name="DEPARTMENTCODE")
	String departmentCode;
	

	public String getDepartmentCode() {
		return departmentCode;
	}

	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}

	/**
	 * title for teacher
	 */
	@Column(name = "TITLE")
	String teachtitle;

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getTeachtitle() {
		return teachtitle;
	}

	public void setTeachtitle(String teachtitle) {
		this.teachtitle = teachtitle;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getWorkid() {
		return workid;
	}

	public void setWorkid(Long workid) {
		this.workid = workid;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}
}
